import Vue from 'vue'

import 'normalize.css/normalize.css' // A modern alternative to CSS resets

import ElementUI from 'element-ui'
import axios from 'axios'
Vue.prototype.$axios = axios
import 'element-ui/lib/theme-chalk/index.css'
import locale from 'element-ui/lib/locale/lang/zh-CN' // lang i18n
import Banner from '@/components/Banner/index.vue'
import Panel from '@/components/Panel/index.vue'
import Page from '@/components/Container/page.vue'
import TitleBar from '@/components/Banner/Title.vue'
import Pagination from '@/components/Pagination/index.vue'

import '@/styles/index.scss' // global css
import '@/styles/gwd_overall.scss'

import '@/styles/lgh_overall.scss'

// import '@/styles/page.scss'
// import '@/styles/staffmanagement.scss'
// import '@/styles/divisionalManagement.scss'
// import '@/styles/log.scss'

import App from './App'
import store from './store'
import router from './router'

import echarts from 'echarts/lib/echarts'
import '@/icons' // icon
import '@/permission' // permission control
import 'echarts/lib/chart/bar'
import 'echarts/lib/chart/pie'
import 'echarts/lib/chart/line'
import 'echarts/lib/component/tooltip'
import 'echarts/lib/component/legend'
import 'echarts/lib/component/title'
import '@/styles/wn_user.scss'
// import Blob from '@/excel/Blob.js'
// import Export2Excel from '@/excel/Export2Excel.js'
import '@/utils/util.js'
/**
 * If you don't want to use mock-server
 * you want to use MockJs for mock api
 * you can execute: mockXHR()
 *
 * Currently MockJs will be used in the production environment,
 * please remove it before going online! ! !
 */
import { mockXHR } from '../mock'
if (process.env.NODE_ENV === 'production') {
  mockXHR()
}

Vue.prototype.$echarts = echarts
Vue.prototype.$axios = axios
// set ElementUI lang to EN
Vue.use(ElementUI, { locale })

const components = [
  Banner,
  Panel,
  Page,
  TitleBar,
  Pagination
]
components.forEach(component => {
  Vue.component(component.name, component)
})

Vue.config.productionTip = false

new Vue({
  el: '#app',
  router,
  store,
  render: h => h(App)
})
